#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;
class Solution {
public:
    bool _validPalindrome(string s, int i,int j)
    {
        while (i < j)
        {
            if (s[i++] != s[j--]) return false;
        }
        return true;

    }
    bool validPalindrome(string s)
    {
        int n = s.size();
        int i = 0,j = n-1;
        while (i < j)
        {
            if (s[i] != s[j]) return _validPalindrome(s, i + 1, j) || _validPalindrome(s, i, j - 1);
            i++;
            j--;
        }
        return true;
    }
};
int main()
{
    Solution s;
    string str("abc");
    int ret = s.validPalindrome(str);
    cout << ret << endl;
    return 0;
}